package my.soft.aiteacher.exception;

import my.soft.aiteacher.utils.R;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestControllerAdvice;

@RestControllerAdvice
public class GobleException {
    @ResponseBody
    @ExceptionHandler(BusinessException.class)
    public R exceptionHandler(BusinessException e){
        return R.error(e.getCode(),e.getMessage());
    }
}
